package sockettest;

import  java.net.InetAddress;
import java.net.UnknownHostException;

public class TestlnetAddress {
    public static void main(){
        try {
            InetAddress inet = InetAddress.getByName("localhost");
            System.out.println(inet);
            System.out.println(inet.getHostName());
            System.out.println(inet.getHostAddress());
            InetAddress inetl = InetAddress.getLocalHost();
            System.out.println(inetl);
        }catch (UnknownHostException e){
            e.printStackTrace();
        }


    }
}
